package com.xbongbong.paas.model;

import com.xbongbong.paas.domain.entity.ClueJointRecheckEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lrj
 * @date 2021/11/25 13:52
 */

public interface ClueJointRecheckModel extends IModel<ClueJointRecheckEntity> {

    /**
     * 插入实体
     * @param clueJointRecheckEntity
     * @return
     */
    Integer insert(ClueJointRecheckEntity clueJointRecheckEntity) throws XbbException;

    /**
     * 更新设置的规则数据
     * @param clueJointRecheckEntity
     * @return
     */
    Integer update(ClueJointRecheckEntity clueJointRecheckEntity);

    /**
     * 通过formId查找数据
     * @param formId
     * @param corpid
     * @return
     */
    List<ClueJointRecheckEntity> getByFormId(@Param("formId") Long formId, @Param("corpid") String corpid);

    /**
     * 通过formId和linkBusinessType查找数据
     * @param formId
     * @param linkBusinessType
     * @param corpid
     * @return
     */
    ClueJointRecheckEntity getByFormIdAndLinkBusinessType(Long formId, Integer linkBusinessType, String corpid);

    List<ClueJointRecheckEntity> getByFormIdListByScript(List<Long> formIdIn, List<Integer> businessTypeList, List<String> corpIdIn);

    /**
     * 通过formId删除数据
     * @param formId
     * @param corpid
     * @return
     */
    Integer deleteByForm(@Param("formId") Long formId, @Param("corpid") String corpid);

}
